VERSION=openeuler24.03-opengauss6.0.0-0.1

GET_CONTAINER_ID=$(eval CONTAINER_ID=$(shell docker run -itd --rm wold9168/openeuler-docker-opengauss-riscv64:${VERSION}-only-build))

.PHONY: build only-compile cpfile
build:
	docker buildx build -t wold9168/openeuler-docker-opengauss-riscv64:${VERSION} .

only-compile:
	docker buildx build --target builder -t wold9168/openeuler-docker-opengauss-riscv64:${VERSION}-only-build .

cpfile:
	$(GET_CONTAINER_ID)	
	echo ${CONTAINER_ID}
	docker cp ${CONTAINER_ID}:/root/rpmbuild/RPMS/riscv64/ .
	docker stop ${CONTAINER_ID}
